﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VirtualDisk
{
    class DiskNode
    {
        //节点的名字
        private MyString name;
        //节点的父亲
        private DiskNode parrentNode = null;
        //节点创建的时间
        private DateTime createDate;
        public DiskNode(MyString name, DateTime date)
        {
            this.name = name;
            this.createDate = date;
        }



        public MyString Name
        {
            get { return name; }
        }

        public DateTime CreateDate
        {
            get { return createDate; }
        }

        public DiskNode Parent
        {
            get { return parrentNode; }
            set { parrentNode = value; }
        }

        public MyString getPath()
        {
            MyString path = this.name;
            if (this.parrentNode != null)
            {
                path = this.parrentNode.getPath() + new MyString("\\") + this.name;
            }
            return path;
        }

        public enum ShowOptions
        {
            OnlyDircory,
            OnlyFile,
            DircoryAndFile
        }
        public virtual void showInfo(ShowOptions option)
        {
            

        }

        public virtual void showAllInfo(ShowOptions option)
        {

        }
        public virtual void addNode(DiskNode n)
        {

        }

        public virtual void removeNode(DiskNode n)
        {

        }

        public virtual DiskNode getNode(MyString name)
        {
            return null;
        }



    }
}
